<template>
  <!-- 上中下布局 router-link自带类名actiove -->
 <div>
     <Shopheader />
    <div class="tab">
         
      <div class="tab-item">
        <router-link to="/shop/goods" replace>点餐</router-link>
      </div>
      <div class="tab-item">
        <router-link to="/shop/ratings" replace>评价</router-link>
      </div>
      <div class="tab-item">
        <router-link to="/shop/info" replace>商家</router-link>
      </div>
    </div>
    <keep-alive>
          <router-view></router-view>
    </keep-alive>
  </div> 
</template>

<script>
import Shopheader from '../../components/ShopHeader/ShopHeader'
export default {
    //报错结果显示超过最大调用堆栈大小（并不清楚）查询一些信息后发现引入的组件名和当前文件的命名重复了，修改之后就好了
  name: "ShopHeader",
  components: {
    Shopheader,
  },
  mounted(){
    this.$store.dispatch('getShopsInfo')
  },
};
</script>

<style lang="stylus" rel="stylesheet/stylus">
@import '../../common/stylus/mixins.styl';
  .tab
    height 40px
    line-height 40px
    background #fff
    bottom-border-1px(rgba(7, 17, 27, 0.1))
    .tab-item
      float left
      width: 33.33333%
      text-align center
      font-size 14px
      color rgb(77, 85, 93)
      a
        display block
        position relative
        &.router-link-active
          color #02a774
          &::after
            content ''
            position absolute
            left 50%
            bottom 1px
            width 35px
            height 2px
            transform translateX(-50%)
            background #02a774
</style>